<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="mailbox-babylmessage.html" />
<link rel="prev" href="mailbox-mboxmessage.html" />
<link rel="parent" href="mailbox-message-objects.html" />
<link rel="next" href="mailbox-babylmessage.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>7.3.2.3 MHMessage</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="7.3.2.2 mboxMessage"
  href="mailbox-mboxmessage.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="7.3.2 message objects"
  href="mailbox-message-objects.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="7.3.2.4 BabylMessage"
  href="mailbox-babylmessage.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="mailbox-mboxmessage.html">7.3.2.2 mboxMessage</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="mailbox-message-objects.html">7.3.2 Message objects</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="mailbox-babylmessage.html">7.3.2.4 BabylMessage</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h3><a name="SECTION009323000000000000000"></a>
<a name="mailbox-mhmessage"></a>
<br>
7.3.2.3 <tt class="class">MHMessage</tt>
</h3>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-1427' xml:id='l2h-1427' class="class">MHMessage</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>message</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
A message with MH-specific behaviors. Parameter <var>message</var> has the same
meaning as with the <tt class="class">Message</tt> constructor.
</dl>

<p>
MH messages do not support marks or flags in the traditional sense, but they do
support sequences, which are logical groupings of arbitrary messages. Some mail
reading programs (although not the standard <b class="program">mh</b> and <b class="program">nmh</b>) use
sequences in much the same way flags are used with other formats, as follows:

<p>
<div class="center"><table class="realtable">
  <thead>
    <tr>
      <th class="left"  >Sequence</th>
      <th class="left"  >Explanation</th>
      </tr>
    </thead>
  <tbody>
    <tr><td class="left"   valign="baseline">unseen</td>
        <td class="left"  >Not read, but previously detected by MUA</td></tr>
    <tr><td class="left"   valign="baseline">replied</td>
        <td class="left"  >Replied to</td></tr>
    <tr><td class="left"   valign="baseline">flagged</td>
        <td class="left"  >Marked as important</td></tr></tbody>
</table></div>

<p>
<tt class="class">MHMessage</tt> instances offer the following methods:

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-1428' xml:id='l2h-1428' class="method">get_sequences</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Return a list of the names of sequences that include this message.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-1429' xml:id='l2h-1429' class="method">set_sequences</tt></b>(</nobr></td>
  <td><var>sequences</var>)</td></tr></table></dt>
<dd>
Set the list of sequences that include this message.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-1430' xml:id='l2h-1430' class="method">add_sequence</tt></b>(</nobr></td>
  <td><var>sequence</var>)</td></tr></table></dt>
<dd>
Add <var>sequence</var> to the list of sequences that include this message.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-1431' xml:id='l2h-1431' class="method">remove_sequence</tt></b>(</nobr></td>
  <td><var>sequence</var>)</td></tr></table></dt>
<dd>
Remove <var>sequence</var> from the list of sequences that include this message.
</dl>

<p>
When an <tt class="class">MHMessage</tt> instance is created based upon a
<tt class="class">MaildirMessage</tt> instance, the following conversions take place:

<p>
<div class="center"><table class="realtable">
  <thead>
    <tr>
      <th class="left"  >Resulting state</th>
      <th class="left"  ><tt class="class">MaildirMessage</tt> state</th>
      </tr>
    </thead>
  <tbody>
    <tr><td class="left"   valign="baseline">"unseen" sequence</td>
        <td class="left"  >no S flag</td></tr>
    <tr><td class="left"   valign="baseline">"replied" sequence</td>
        <td class="left"  >R flag</td></tr>
    <tr><td class="left"   valign="baseline">"flagged" sequence</td>
        <td class="left"  >F flag</td></tr></tbody>
</table></div>

<p>
When an <tt class="class">MHMessage</tt> instance is created based upon an <tt class="class">mboxMessage</tt>
or <tt class="class">MMDFMessage</tt> instance, the <span class="mailheader">Status:</span> and
<span class="mailheader">X-Status:</span> headers are omitted and the following conversions take
place:

<p>
<div class="center"><table class="realtable">
  <thead>
    <tr>
      <th class="left"  >Resulting state</th>
      <th class="left"  ><tt class="class">mboxMessage</tt> or <tt class="class">MMDFMessage</tt> state</th>
      </tr>
    </thead>
  <tbody>
    <tr><td class="left"   valign="baseline">"unseen" sequence</td>
        <td class="left"  >no R flag</td></tr>
    <tr><td class="left"   valign="baseline">"replied" sequence</td>
        <td class="left"  >A flag</td></tr>
    <tr><td class="left"   valign="baseline">"flagged" sequence</td>
        <td class="left"  >F flag</td></tr></tbody>
</table></div>

<p>
When an <tt class="class">MHMessage</tt> instance is created based upon a <tt class="class">BabylMessage</tt>
instance, the following conversions take place:

<p>
<div class="center"><table class="realtable">
  <thead>
    <tr>
      <th class="left"  >Resulting state</th>
      <th class="left"  ><tt class="class">BabylMessage</tt> state</th>
      </tr>
    </thead>
  <tbody>
    <tr><td class="left"   valign="baseline">"unseen" sequence</td>
        <td class="left"  >"unseen" label</td></tr>
    <tr><td class="left"   valign="baseline">"replied" sequence</td>
        <td class="left"  >"answered" label</td></tr></tbody>
</table></div>

<p>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="7.3.2.2 mboxMessage"
  href="mailbox-mboxmessage.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="7.3.2 message objects"
  href="mailbox-message-objects.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="7.3.2.4 BabylMessage"
  href="mailbox-babylmessage.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="mailbox-mboxmessage.html">7.3.2.2 mboxMessage</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="mailbox-message-objects.html">7.3.2 Message objects</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="mailbox-babylmessage.html">7.3.2.4 BabylMessage</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
